<!--<script type="text/javascript" src="http://www.longtailvideo.com/jwplayer/key.js?1375350212"></script>-->
<div id="left_side">
	<div id="home_live">
		<h1 class="tab tabDark">You2Play Live TV</h1>
		<!--Vdo Player-->
		<div id="vdoPlayer">
			<?php if($this->agent->is_mobile()):?>
				<video id='my_video' controls preload='none'></video>
			<?php endif;?>
		</div>
		<!--Facebook Plugin-->
		<?php echo $module_facebook_plugins_share;?>
		<!--Comment-->
		<div id="video_play_comment">
			<h2>
				<span>แสดงความคิดเห็น</span>
			</h2>
			<!--Facebook Comment-->
			<?php echo $module_facebook_plugins_comment;?>
		</div>
	</div>	
</div>
<div id="right_side">
	<!--Module-->
	<?php
	if(!empty($module))
	foreach($module as $value):?>
	<?php echo $value;?>
	<?php endforeach;?>
</div>
<!-- Hawkeye : The First Script is PreQual -->
<script type="text/javascript" language="JavaScript">
	//name: You2Play (Direct_Thailand) PreRoll 
	//created: 09/26/2013 16:51
										
	var cb = new Date().getTime();							
	var asiPqTag = false;							
	try { 								
		document.write("<sc" + "ript type='text/javascript' language='JavaScript' src='//pq-direct.revsci.net/pql?placementIdList=0qHox8&cb=" + cb + "'></sc" + "ript>");						
	} catch(err) { }						
</script>
<!-- Hawkeye: Ending The First Script -->	
<!-- Hawkeye : The second script is PASIT code for Videoplaza -->
<script type="text/javascript">
	if (typeof asiPlacements != "undefined") {
		var gwdTagData = 'adgroup=' + asiPlacements['0qHox8'].default.key + '&blob=' + asiPlacements['0qHox8'].blob;
		if ('0qHox8' in asiPlacements) {
			var gwdTagData = 'adgroup=' + asiPlacements['0qHox8'].default.key + '&blob=' + asiPlacements['0qHox8'].blob;
		}
		for(var p in asiPlacements) {
			if(asiPlacements[p].default&&asiPlacements[p].default.key){ window["ASPQ_"+p]="PQ_"+p; }
		}
	}
</script>
<!--  Hawkeye: Ending The Second Script -->	
<script type="text/javascript" language="javascript">
(function($) {
/*whatever jQuery stuff*/
	$(function(){
		var is_mobile = '<?php echo $this->agent->is_mobile();?>';
		var url_html5 = "http://203.151.21.9:1935/live/You2PlayTV_1/playlist.m3u8";
		var url_flash = "rtmp://203.151.21.9/live";
		if(is_mobile){
			//Set Video Source
			$('#my_video').append("<source id='mp4' src='"+url_html5+"' type='video/mp4'>");
			$('#my_video').attr('src',""+url_html5+"");
			$('#my_video').attr('width',640);
			$('#my_video').attr('height',362);		
			// videoplaza sdk, 4 sec time-out, callback function
			//loadScript("<?php echo js_asset_url('media/html5-sdk-1.0.12.15.1-ea.min.js');?>",4000,initVideoplaza);
			// *** START - videoplaza plugin config ***
/*			vpConfig = {
				vphost : 'http://th-pmdplus.videoplaza.tv',
				category : 'live',
				//tags : ['standard'],
				tags : [myDynamicTag()],
				contentId : mygwdTagData(),
				flags: [],
				playbackPosition: [] // mid-roll cue points, if any.
			}*/
			// *** END - videoplaza plugin config ***
			//Auto Play && Loop
			$('#my_video').attr('autoplay','autoplay');	
		} else {
			jwplayer("vdoPlayer").setup({
				autostart: true,
		      	flashplayer: "<?php echo js_asset_url('media/player.swf');?>",
		      	width: 640,
		      	height: 362,
				streamer: ""+url_flash+"",
				file: "You2PlayTV_1",
				provider: "rtmp",
/*				"plugins": {
					"ova-jw": {
						"canFireEventAPICalls": true,
						"ads": {
							"skipAd": {
								"enabled": "true"
							},
							"schedule": [
							{
								"position": "pre-roll",
								"tag": ""+generatTag('<?php //echo json_encode($dataAds);?>')+""
							}	  
							]
						}
					}
				}	*/				
		      	plugins: "<?php echo js_asset_url('media/vp_plugin.swf');?>",
		      	vpdomain: "http://th-pmdplus.videoplaza.tv",
		      	vpshares: "live",			
				vptimeout: 15000,
		      	vptags: myDynamicTag(),
			  	vpContentid: mygwdTagData(),	
				stretching : "exactfit"	
			});
/*			jwplayer("vdoPlayer").setup({
			    //image: "http://content.bitsontherun.com/thumbs/s8BPzDe0-640.jpg",
			    file: "http://203.151.21.9:1935/live/smil:You2PlayTV.smil/playlist.m3u8"
			});*/
		}	
	});	
})(jQuery);
</script>